package com.softwinner.awbt.fragment;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.View;

/**
 * Created by xiasj on 17-12-29.
 */

public class BaseFragment extends Fragment {

    private boolean isDetach = true;


    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        isDetach = false;
    }

    @Override
    public void onDetach() {
        super.onDetach();
        isDetach = true;
    }

    public boolean isDetach() {
        return isDetach;
    }

    protected void showMessage(View view, int message) {
        if (view != null) {
            try {
                Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show();
            }catch (IllegalArgumentException e) {

            }
        }
    }
}
